<template>
	<div class="top">
			<!--<router-link to="/admin/yushebj">
				<div class="tp" style="background:#409EFF;color: white;"><i class="el-icon-search" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">开班</span></div>
			</router-link>-->
			<!--<router-link to="/cost/baoming">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-document" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">新生报名</span></div>
			</router-link>-->
			<!-- <router-link to="/educa/msg">
				<div class="tp" style="background:#F56C6C;color: white;"><i class="el-icon-bell" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">学生信息</span></div>
			</router-link> -->
			<!--<div class="tp" @click="baoming" style="background:#409EFF;color: white;"><i class="el-icon-goods" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">报名</span></div>-->
			<div v-for = 'i in zdylist'>
				<router-link :to=i.path>
				<div class="tp" @click="componentsShow(i.click)" :style="i.ys"><i :class="i.tb" style="margin: 5px 0;font-size:24px; color: white;"></i><br><span style="font-size:14px;color:white">{{i.mc}}</span></div>
				</router-link>
			</div>
			<div class="tp" v-if='xzmk' @click="componentsShow('bmjf')"     style="background:#409EFF;color: white;"><i class="el-icon-document" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">行政模块</span></div>
		    <div class="tp" v-if='jwmk' @click="componentsShow('jwrw')"     style="background:#67C23A;color: white;"><i class="el-icon-bell"     style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">教务模块</span></div>
			<div class="tp" v-if='cwmk' @click="componentsShow('jf')"       style="background:#E6A23C;color: white;"><i class="el-icon-printer"  style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">财务模块</span></div>
			<div class="tp" v-if='jxc' @click="componentsShow('bigjxcgl')" style="background:#F56C6C;color: white;"><i class="el-icon-sold-out" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">进销存</span></div>
			<div class="tp" v-if='jcsz' @click="componentsShow('jcsz')"     style="background:#66CC99;color: white;"><i class="el-icon-setting"  style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">基础设置</span></div>
			<div class="tp" v-if='tjfx' @click="componentsShow('tj')"       style="background:#DF56F7;color: white;"><i class="el-icon-tickets"  style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">统计分析</span></div>
			
			<!--<div class="tp" @click="componentsShow('xzrw')" style="background:#409EFF;color: white;"><i class="el-icon-goods" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">行政任务</span></div>-->
			<!--<div class="tp" @click="componentsShow('tzgl')" style="background:#409EFF;color: white;"><i class="el-icon-goods" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">财务管理</span></div>-->

			<!--<div class="tp" @click="componentsShow('htsz')" style="background:#EB9E05;color: white;"><i class="el-icon-question" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">后台设置</span></div>-->

			<!--<div class="tp" @click="componentsShow('kb')" style="background:#7479F9;color: white;"><i class="el-icon-printer" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">课表</span></div>-->
			<!--<div class="tp" @click="componentsShow('jxcgl')" style="background:#5FDECB;color: white;"><i class="el-icon-sold-out" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">教材库存</span></div>
			<div class="tp" @click="componentsShow('gdjxcgl')" style="background:#9F5FDE;color: white;"><i class="el-icon-sold-out" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">固定资产</span></div>
			<div class="tp" @click="componentsShow('xhjxcgl')" style="background:#DE5FB8;color: white;"><i class="el-icon-sold-out" style="margin: 5px 0;font-size:24px;"></i><br><span style="font-size:14px ;">办公用品</span></div>-->

			
			<!--<router-link to="/admin/jiaoshi">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-edit" style="margin: 10px 0;font-size:50px;"></i><br><span>教室</span></div>
			</router-link>
			<router-link to="/manage/kccx">
				<div class="tp" style="background:#EB9E05;color: white;"><i class="el-icon-star-off" style="margin: 10px 0;font-size:50px;"></i><br><span>库存</span></div>
			</router-link>
			<router-link to="/manage/bs">
				<div class="tp" style="background:#FA5555;color: white;margin-right: 0;"><i class="el-icon-document" style="margin: 10px 0 ;font-size:50px;"></i><br><span>报损</span></div>
			</router-link>
			<router-link to="/admin/person">
				<div class="tp" style="background:#8D4FF2;color: white;"><i class="el-icon-message" style="margin: 10px 0;font-size:50px;"></i><br><span>人员</span></div>
			</router-link>
			<router-link to="/cost/student-free">
				<div class="tp" style="background:#FA5555;color: white;"><i class="el-icon-document" style="margin: 10px 0 ;font-size:50px;"></i><br><span>退费审核</span></div>
			</router-link>
			<router-link to="/cost/payjl">
				<div class="tp" style="background:#8D4FF2;color: white;"><i class="el-icon-message" style="margin: 10px 0;font-size:50px;"></i><br><span>缴费记录</span></div>
			</router-link>
			<router-link to="/cost/baoming">
				<div class="tp" style="background:#409EFF;color: white;"><i class="el-icon-search" style="margin: 10px 0;font-size:50px;"></i><br><span>报名管理</span></div>
			</router-link>
			<router-link to="/cost/free-records">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-edit" style="margin: 10px 0;font-size:50px;"></i><br><span>退费统计</span></div>
			</router-link>
			<router-link to="/educa/check">
				<div class="tp" style="background:#EB9E05;color: white;"><i class="el-icon-star-off" style="margin: 10px 0;font-size:50px;"></i><br><span>考勤</span></div>
			</router-link>
			<router-link to="/educa/course">
				<div class="tp" style="background:#FA5555;color: white;margin-right: 0;"><i class="el-icon-document" style="margin: 10px 0 ;font-size:50px;"></i><br><span>排课管理</span></div>
			</router-link>
			<router-link to="/educa/tingshuozy">
				<div class="tp" style="background:#8D4FF2;color: white;"><i class="el-icon-message" style="margin: 10px 0;font-size:50px;"></i><br><span>听说作业</span></div>
			</router-link>
			<router-link to="/cost/pay">
				<div class="tp" style="background:#409EFF;color: white;"><i class="el-icon-search" style="margin: 10px 0;font-size:50px;"></i><br><span>续缴管理</span></div>
			</router-link>
			<router-link to="/educa/student">
				<div class="tp" style="background:#67C23A;color: white;"><i class="el-icon-edit" style="margin: 10px 0;font-size:50px;"></i><br><span>学生管理</span></div>
			</router-link>
			<router-link to="/educa/workcj">
				<div class="tp" style="background:#EB9E05;color: white;"><i class="el-icon-star-off" style="margin: 10px 0;font-size:50px;"></i><br><span>作业成绩</span></div>
			</router-link>
			<router-link to="/manage/lytl">
				<div class="tp" style="background:#FA5555;color: white;"><i class="el-icon-document" style="margin: 10px 0 ;font-size:50px;"></i><br><span>领用退领</span></div>
			</router-link>
			<router-link to="/manage/pd">
				<div class="tp" style="background:#8D4FF2;margin-right: 0;color: white;"><i class="el-icon-message" style="margin: 10px 0;font-size:50px;"></i><br><span>盘点</span></div>
			</router-link>-->
			<Homeykbjbigjxcgllist v-if="portComponents.bigjxcgl.toggle" @close="componentsHide" :params="portComponents.bigjxcgl.params"></Homeykbjbigjxcgllist>
			<Homeykbjbmjflist v-if="portComponents.bmjf.toggle" @close="componentsHide" :params="portComponents.bmjf.params"></Homeykbjbmjflist>
			<Homeykbjhtszlist v-if="portComponents.htsz.toggle" @close="componentsHide" :params="portComponents.htsz.params"></Homeykbjhtszlist>
			<Homeykbjjcszlist v-if="portComponents.jcsz.toggle" @close="componentsHide" :params="portComponents.jcsz.params"></Homeykbjjcszlist>
			<Homeykbjjwrwlist v-if="portComponents.jwrw.toggle" @close="componentsHide" :params="portComponents.jwrw.params"></Homeykbjjwrwlist>
			<Homeykbjxzrwlist v-if="portComponents.xzrw.toggle" @close="componentsHide" :params="portComponents.xzrw.params"></Homeykbjxzrwlist>
			<Homeykbjjxcgllist v-if="portComponents.jxcgl.toggle" @close="componentsHide" :params="portComponents.jxcgl.params"></Homeykbjjxcgllist>
			<Homeykbjgdjxcgllist v-if="portComponents.gdjxcgl.toggle" @close="componentsHide" :params="portComponents.gdjxcgl.params"></Homeykbjgdjxcgllist>
			<Homeykbjxhjxcgllist v-if="portComponents.xhjxcgl.toggle" @close="componentsHide" :params="portComponents.xhjxcgl.params"></Homeykbjxhjxcgllist>
			<Homeykbjtzgllist v-if="portComponents.tzgl.toggle" @close="componentsHide" :params="portComponents.tzgl.params"></Homeykbjtzgllist>
			<Homeykbjtjlist v-if="portComponents.tj.toggle" @close="componentsHide" :params="portComponents.tj.params"></Homeykbjtjlist>
			<Homeykbjjflist v-if="portComponents.jf.toggle" @close="componentsHide" :params="portComponents.jf.params"></Homeykbjjflist>
			<Homeykbjkblist v-if="portComponents.kb.toggle" @close="componentsHide" :params="portComponents.kb.params"></Homeykbjkblist>
			
			<Homebaominglist v-if="portComponents.lsjf.toggle" @close="componentsHide" :params="{zt:2}"></Homebaominglist>
			<Homebaominglist v-if="portComponents.xsbm.toggle" @close="componentsHide" :params="{zt:1}"></Homebaominglist>
			<!--<Homebaominglist v-if="showbaoming" @close="baomingtoggle" :params="this.zt"></Homebaominglist>-->
		    <Lskb class="lskb" v-if="portComponents.lskb.toggle" @close="componentsHide" :data="portComponents.lskb.data"></Lskb>
			<Jskb class="lskb" v-if="portComponents.jskb.toggle" @close="componentsHide" :data="portComponents.jskb.data"></Jskb>
		    <qxszComponent v-if="portComponents.qxsz.toggle"  @close="componentsHide"  :params="111"></qxszComponent>
			
	</div>
</template>
<script type="text/javascript">
	import qs from 'qs'
	import qxszComponent from '@/view/admin/personManage/ryqxsz'
	import Homeykbjbigjxcgllist from '../../view/educa/bjxx/bigjxcgl'
	import Homeykbjhtszlist from '../../view/educa/bjxx/htsz'
	import Homeykbjjcszlist from '../../view/educa/bjxx/jcsz'
	import Homeykbjbmjflist from '../../view/educa/bjxx/bmjf'
	import Homeykbjjwrwlist from '../../view/educa/bjxx/jwrw'
	import Homeykbjxzrwlist from '../../view/educa/bjxx/xzrw'
	import Homeykbjjxcgllist from '../../view/educa/bjxx/jxcgl'
	import Homeykbjgdjxcgllist from '../../view/educa/bjxx/gdjxcgl'
	import Homeykbjxhjxcgllist from '../../view/educa/bjxx/xhjxcgl'
	import Homeykbjtzgllist from '../../view/educa/bjxx/tzgl'
	import Homeykbjtjlist from '../../view/educa/bjxx/tj'
	import Homeykbjjflist from '../../view/educa/bjxx/jf'
	import Homeykbjkblist from '../../view/educa/bjxx/kb'
//	import Homebaominglist from '../../view/cost/baoming/add'
	import Homebaominglist from '@/view/cost/baoming/add'
	import Jskb from '@/view/admin/yushebjManage/kebiao/jskb'
	import Lskb from '@/view/admin/yushebjManage/kebiao/lskb'
	
	
	
	export default {
			components: { Homebaominglist,Lskb ,Jskb,qxszComponent,Homeykbjhtszlist,Homeykbjbigjxcgllist, Homeykbjjcszlist, Homeykbjbmjflist,Homeykbjjwrwlist,Homeykbjxzrwlist,Homeykbjjxcgllist,Homeykbjgdjxcgllist,Homeykbjxhjxcgllist,Homeykbjtzgllist,Homeykbjtjlist,Homeykbjjflist,Homeykbjkblist},
		data() {
			return {
				    xzmk: true,
				    jwmk: true,
				    cwmk: true,
				    jxc: true,
				    jcsz: true,
				    tjfx: true,
					zdylist:'',
					toggle: false,
//					showbaoming:false,
				portComponents: {
					bigjxcgl: {
						type: 'bigjxcgl',
						toggle: false,
						params: '',
						data: {}
					},
					
	                 htsz: {
						type: 'htsz',
						toggle: false,
						params: '',
						data: {}
					},
					jcsz: {
						type: 'jcsz',
						toggle: false,
						params: '',
						data: {}
					},
					bmjf: {
						type: 'bmjf',
						toggle: false,
						params: '',
						data: {}
					},
					lskb: {
                        type: 'lskb',
                        toggle: false,
                        params: '',
                        data: {}
                    },
                     jskb: {
                        type: 'jskb',
                        toggle: false,
                        params: '',
                        data: {}
                    },
					jwrw: {
						type: 'jwrw',
						toggle: false,
						params: '',
						data: {}
					},
					qxsz: {
						type: 'qxsz',
						toggle: false,
						params: '',
						data: {}
					},
					xzrw: {
						type: 'xzrw',
						toggle: false,
						params: '',
						data: {}
					},
					tzgl: {
						type: 'tzgl',
						toggle: false,
						params: '',
						data: {}
					},
					tj: {
						type: 'tj',
						toggle: false,
						params: '',
						data: {}
					},
					jxcgl: {
						type: 'jxcgl',
						toggle: false,
						params: '',
						data: {}
					},
					gdjxcgl: {
						type: 'gdjxcgl',
						toggle: false,
						params: '',
						data: {}
					},
					xhjxcgl: {
						type: 'xhjxcgl',
						toggle: false,
						params: '',
						data: {}
					},
					jf: {
						type: 'jf',
						toggle: false,
						params: '',
						data: {}
					},
					kb: {
						type: 'kb',
						toggle: false,
						params: '',
						data: {}
					},
					lsjf: {
						type: 'lsjf',
						toggle: false,
						params: '',
						data: {}
					},
					xsbm: {
						type: 'xsbm',
						toggle: false,
						params: '',
						data: {}
					}
                }
			}
		},
		created() {
			    
				 var logininfo = JSON.parse(localStorage.logininfo) ;
//				 console.log(logininfo,'llllllllllllllllllll')
				 	if(    logininfo.auth.indexOf("c001x")==-1 
				 	   &&  logininfo.auth.indexOf("c002x")==-1
				 	   &&  logininfo.auth.indexOf("c003x")==-1
				 	   &&  logininfo.auth.indexOf("c004x")==-1
				 	   &&  logininfo.auth.indexOf("c006x")==-1
				 	   &&  logininfo.auth.indexOf("c007x")==-1
				 	   &&  logininfo.auth.indexOf("c008x")==-1
				 	   &&  logininfo.auth.indexOf("c047x")==-1
				 	   &&  logininfo.auth.indexOf("c049x")==-1
				 	   &&  logininfo.auth.indexOf("c061x")==-1
				 	   &&  logininfo.auth.indexOf("c062x")==-1
				 	){
				 		this.xzmk=false
				 	}
				 	if(    logininfo.auth.indexOf("c009x")==-1 
				 	   &&  logininfo.auth.indexOf("c010x")==-1
				 	   &&  logininfo.auth.indexOf("c011x")==-1
				 	   &&  logininfo.auth.indexOf("c013x")==-1
				 	   &&  logininfo.auth.indexOf("c014x")==-1
				 	   &&  logininfo.auth.indexOf("c046x")==-1
				 	   &&  logininfo.auth.indexOf("c048x")==-1
				 	){
				 		this.jwmk=false
				 	}
				 	if(    logininfo.auth.indexOf("c015x")==-1 
				 	   &&  logininfo.auth.indexOf("c016x")==-1
				 	   &&  logininfo.auth.indexOf("c017x")==-1
				 	   &&  logininfo.auth.indexOf("c018x")==-1
				 	   &&  logininfo.auth.indexOf("c019x")==-1
				 	){
				 		this.cwmk=false
				 	}
				 	if(    logininfo.auth.indexOf("c020x")==-1 
				 	   &&  logininfo.auth.indexOf("c021x")==-1
				 	   &&  logininfo.auth.indexOf("c022x")==-1
				 	   &&  logininfo.auth.indexOf("c064x")==-1
				 	   &&  logininfo.auth.indexOf("c065x")==-1
				 	){
				 		this.jxc=false
				 	}
				 	if(    logininfo.auth.indexOf("c030x")==-1 
				 	   &&  logininfo.auth.indexOf("c031x")==-1
				 	   &&  logininfo.auth.indexOf("c032x")==-1
				 	   &&  logininfo.auth.indexOf("c033x")==-1
				 	   &&  logininfo.auth.indexOf("c034x")==-1
				 	   &&  logininfo.auth.indexOf("c035x")==-1
				 	   &&  logininfo.auth.indexOf("c036x")==-1
				 	   &&  logininfo.auth.indexOf("c037x")==-1
				 	   &&  logininfo.auth.indexOf("c038x")==-1
				 	   &&  logininfo.auth.indexOf("c066x")==-1
				 	   &&  logininfo.auth.indexOf("c067x")==-1
				 	){
				 		this.jcsz=false
				 	}
				 	if(    logininfo.auth.indexOf("c039x")==-1 
				 	   &&  logininfo.auth.indexOf("c041x")==-1
				 	   &&  logininfo.auth.indexOf("c042x")==-1
				 	   &&  logininfo.auth.indexOf("c043x")==-1
				 	   &&  logininfo.auth.indexOf("c044x")==-1
				 	   &&  logininfo.auth.indexOf("c045x")==-1
				 	   &&  logininfo.auth.indexOf("c063x")==-1
				 	){
				 		this.tjfx=false
				 	}
			
			 this.getzdylist();
		},
		methods: {
//			baoming(zt){
//				this.zt = {zt:zt}
//				this.showbaoming = true
//			},
//			baomingtoggle(){
//				this.showbaoming = false
//			},
			getzdylist () {
            var logininfo = JSON.parse(localStorage.logininfo) ;
            var params3 = qs.stringify({
              yhid:logininfo.id,
              xxid:logininfo.xxid
			});
              this.searchLoading = true;
              this.axios.post(this.$store.state.api + 'ls/getgxhcd',params3)
              .then( res => {
//            	  console.log(res,'ddddd')
              	  this.zdylist = res.data.data.list
                  this.searchLoading = false;
              }).catch( res => {
                  this.searchLoading = false;
              })
          },
			baomingtoggle(){
				this.showbaoming = false
			},
			componentsShow(type, data) {
				//显示组件
				for(let i in this.portComponents) {
					if(type == this.portComponents[i].type) {
						this.portComponents[i].toggle = true;
						this.portComponents[i].params = data;
						if(this.portComponents[i].data.type == 'single') {
							this.portComponents[i].data.index = data.row.id
						} else if(this.portComponents[i].data.type == 'multiple') {
							this.portComponents[i].data.index = this.multipleDelNum;
						}  else {
							return;
						}
						return;
					}
				}
			},
			componentsHide (setting) { //关闭组件
                if(setting.type == 'bujiao'){
                	this.portComponents.lsjf.toggle = false;
                	this.portComponents.xsbm.toggle = false;
                }
                if(setting.type == 'ryqxsz'){
                	this.portComponents.qxsz.toggle = false;
                }
                for ( let i in this.portComponents ) {
                    if (setting.type == this.portComponents[i].type) {
                        this.portComponents[i].toggle = false;
                        if (!setting.cancel) {
                           this.search();
                        }
                        return;
                    }
                }
            }
		}
	}
</script>
<style lang="less" scoped>
	.top {
		width: 100%;
		margin: 0 auto;
		float: left;
		/*margin-top: 52px;*/
/*		margin-bottom: 10px;*/
		color: white;
		text-align: center;
		font-size: 16px;
/*		background: white;*/
/*		border-top: 3px solid deepskyblue;*/
	}
	.lskb {
			width: 100%;
			height: 100%;
			background: #fff;
			position: absolute;
			top: 0px;
			left: 0%;
			z-index: 50;
			padding-bottom: 100px;
		}
	.tp {
		width: 100px;
		cursor: pointer;
		height: 55px;
		float: left;
		border-radius: 8px;
		margin-right: 15px;
		margin-top: 10px;
		background: white;
		position: relative;
		box-shadow: 7px 7px 7px #B3B3B3;
		border-radius: 8px;
	}
	.tp:hover{
		 transform:scale(1.1);
        -ms-transform:scale(1.1);
        -webkit-transform:scale(1.1);
        -o-transform:scale(1.1);
        -moz-transform:scale(1.1);
	}
</style>
